#include "vtor_life_game.h"

#ifdef __USER_DEMO_PROJECT__

extern VtorBitMap* lifeGame1CalcMap;
extern VtorBitMap* lifeGame1ShowMap;

VtorLifeGame VtorLifeGame_Array[1] = {0};
VtorLifeGame* lifeGame1 = &VtorLifeGame_Array[0];

void VtorLifeGame_Init()
{
	lifeGame1->calcMap = lifeGame1CalcMap;
	lifeGame1->showMap = lifeGame1ShowMap;

	VtorLifeGame* game = lifeGame1;
	for(int y = 0; y < game->showMap->height; y++)
	{
		for(int x = 0; x < game->showMap->width; x++)
		{
			VtorBitMap_SetElement(game->showMap, x, y, rand()%13 < 3);
		}
	}
	memcpy(game->calcMap->data, game->showMap->data,
		game->calcMap->width * game->calcMap->height / 8);

}

#endif // __VTOR_LIFE_GAME__


